<template>
  <Filed label="会诊目的">
    <van-checkbox
        v-for="(item, index) in consultationPurposeList"
        :key="index"
        v-model="item.checked"
        :name="item.value"
        disabled
        icon-size="14px"
        shape="square"
    >{{ item.name }}
    </van-checkbox>
  </Filed>
  <Filed
      class="w-full"
      label="补充说明"
      :value="info.cosultationPurposeDescription"
      open-ellipsis
  />
</template>

<script lang="ts">
import {defineComponent} from "vue";
import Filed from "./Filed.vue";

export default defineComponent({
  name: "ConsultationPurpose",
  components: {Filed},
  props: {
    info: Object,
  },
  data() {
    return {
      consultationPurpose: [],
    };
  },
  computed: {
    consultationPurposeList() {
      return this.consultationPurpose.map((item) => ({
        ...item,
        checked: this.info.cosultationPurposeProfile.includes(item.value),
      }));
    },
  },
  watch: {},
  beforeCreate() {
  },
  created() {
    this.consultationPurpose = [
      {
        "value": 387,
        "name": "患者资料不全",
        "code": null,
        "desc": null
      },
      {
        "value": 388,
        "name": "患者资料与会诊资料不匹配",
        "code": null,
        "desc": null
      },
      {
        "value": 389,
        "name": "病例与医院实际业务不符",
        "code": null,
        "desc": null
      },
      {
        "value": 390,
        "name": "其他",
        "code": null,
        "desc": null
      }
    ];
  },
  beforeMount() {
  },
  mounted() {
  },
  beforeUpdate() {
  },
  updated() {
  },
  methods: {},
  unmounted() {
  },
});
</script>

<style scoped lang="scss"></style>
